package com.guijq.design.practice.one;

/**
 * @Author timyag
 * @Date 2021/4/15 14:20
 * @Version 1.0
 */
public class GameTest {

    public static void main(String[] args) {
        Box general1 = new GeneralBox(100);
        Box poisonBox1 = new PoisonBox(100);

        general1.facade();
        poisonBox1.facade();


        Box general2 = new GeneralBox(200);
        Box poisonBox2 = new PoisonBox(200);

        Box luckyBox1 = new LuckyBox(100);
        Box luckyBox2 = new LuckyBox(200);
        Solider solider = new Solider();
        Mage mage = new Mage();
        System.out.println("初始：" + solider.getHp() + "-" + solider.getMoney());
        general1.beOpenBy(solider);
        System.out.println(solider.getHp() + "-" + solider.getMoney());
        poisonBox1.beOpenBy(solider);
        System.out.println(solider.getHp() + "-" + solider.getMoney());

        general1.beOpenBy(solider);
        System.out.println(solider.getHp() + "-" + solider.getMoney());
        poisonBox1.beOpenBy(solider);
        System.out.println(solider.getHp() + "-" + solider.getMoney());
        poisonBox1.beOpenBy(solider);
        System.out.println(solider.getHp() + "-" + solider.getMoney());
        luckyBox1.beOpenBy(solider);
        System.out.println(solider.getHp() + "-" + solider.getMoney());
        luckyBox1.beOpenBy(solider);
        System.out.println(solider.getHp() + "-" + solider.getMoney());


        System.out.println("初始：" + mage.getHp() + "-" + mage.getMoney());
        general2.beOpenBy(mage);
        System.out.println(mage.getHp() + "-" + mage.getMoney());
        poisonBox2.beOpenBy(mage);
        System.out.println(mage.getHp() + "-" + mage.getMoney());

        general2.beOpenBy(mage);
        System.out.println(mage.getHp() + "-" + mage.getMoney());
        poisonBox2.beOpenBy(mage);
        System.out.println(mage.getHp() + "-" + mage.getMoney());
        poisonBox1.beOpenBy(mage);
        System.out.println(mage.getHp() + "-" + mage.getMoney());
        luckyBox2.beOpenBy(mage);
        System.out.println(mage.getHp() + "-" + mage.getMoney());
        luckyBox2.beOpenBy(mage);
        System.out.println(mage.getHp() + "-" + mage.getMoney());
    }
}
